package com.geeguo.ebuilder.core.common.utils;

public final class SqlHelper {

	private static final String IMPLICTTEMPLATE = "%1$s%2$s%3$s";
	
	/**
	 * 首部%
	 *
	 * @param str
	 * @return
	 */
    public static String getPrefixImplict(String str) {
		if (str != null) {
			return String.format(IMPLICTTEMPLATE, "%", str, "");
		} else {
			return "%%";
		}
    }

    /**
     * 尾部%
     *
     * @param str
     * @return
     */
    public static String getSuffixImplict(String str) {
		if (str != null) {
			return String.format(IMPLICTTEMPLATE, "", str, "%");
		} else {
			return "%%";
		}
    }

    /**
     * 首尾%
     *
     * @param str
     * @return
     */
    public static String getFullImplict(String str) {
		if (str != null) {
			return String.format(IMPLICTTEMPLATE, "%", str, "%");
		} else {
			return "%%";
		}
    }
}